package com.example.myapplication.RoomFile

import androidx.lifecycle.LiveData
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update

@Dao
interface WordDao {
    @Insert
    fun insertWords(vararg words: Word)

    @Update
    fun updateWords(vararg word: Word)

    @Delete
    fun deleteWords(vararg word: Word)

    @Query("DELETE FROM WORD")
    fun deleteAll()

    @Query("SELECT * FROM WORD ORDER BY ID DESC")
    fun getAllWords():LiveData<List<Word>>
}
